package com.example.demo.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @ClassName: Test
 * @Description: TODO
 * @Author: YangGuisen
 * @Date: 2018/9/6 11:00
 * @Version: 1.0
 */
@RestController
public class Test {

    @RequestMapping("/yang")
    public String he(){

        return "yang";
    }


    @GetMapping("/info")
    public String getInfo() throws UnknownHostException {
        InetAddress inetAddress = InetAddress.getLocalHost();
        return "本机ip:"+inetAddress.getHostAddress();
    }

}
